<?php
$player = get_post_meta($post->ID, 'player', true);
$enclosure = get_post_meta($post->ID, 'enclosure', true);
if ($enclosure):
$mp3 = split("\n", $enclosure);
    
if (!$mp3[2] || ($mp3[2] && ereg('audio',$mp3[2]))):
$mediaLabel = 'Audio ';
switch ($mp3[2]) {
	case 'audio/mpeg':
	$mediaLabel .= 'MP3';
	break;
}
?>
<div class="tt-podcast-pane">
<h3>Play the Music</h3>
<div class="control">
	<?php if ($player == 'quicktime'):?>
		<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
			width="100%" height="16"
		   codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"
		   id="mediaplayer" >
		  <param name="src" value="<?php echo $mp3[0]?>" />
		  <param name="autoplay" value="false" />
		  <embed src="<?php echo $mp3[0]?>" width="100%" height="16" 
		    pluginspage="http://www.apple.com/quicktime/download/"
		    autoplay="false" />
		</object>
	<?php elseif ($player == 'windows'): ?>
		[[windows media player]]
	<?php else:?>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
        width="100%" 
        height="25" 
        id="mp3player" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" >
    <param name="movie" value="/wp-content/themes/tantan/mp3/mp3player.swf?config=/wp-content/themes/tantan/mp3/config.xml&file=<?php echo $mp3[0]?>" />
    <param name="wmode" value="transparent" />
    <embed src="/wp-content/themes/tantan/mp3/mp3player.swf?config=/wp-content/themes/tantan/mp3/config.xml&file=<?php echo $mp3[0]?>" 
        wmode="transparent" 
        width="100%" 
        height="25" 
        name="mp3player"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
	<?php endif;?>
</div>    
<small class="meta"><?php echo $mediaLabel?>, <?php echo round($mp3[1] / 1048576, 1);?> MB, <a href="<?php echo $mp3[0]?>" class="mp3Download">Download</a></small>


<?
$purchases = get_post_meta($post->ID, 'purchase');
if (count($purchases) > 0):
?>
<h3>Buy the Music</h3>
<div class="links"><small>
<?
foreach ($purchases as $url):
$parts = parse_url($url);
?>

<a href="<?php echo $url?>"><?php echo $parts['host']?></a><br />
<?endforeach;?>
</small></div>
<?endif;?>

<?
$websites = get_post_meta($post->ID, 'website');
if (count($websites) > 0):
?>
<h3>Related Links</h3>
<div class="links"><small>
<?
foreach ($websites as $url):
$parts = parse_url($url);
?>

<a href="<?php echo $url?>"><?php echo $parts['host']?></a><br />
<?endforeach;?>
</small></div>



<?endif;?>
<!--
<p style="margin:10px 0 0 0">
<a href="http://feeds.feedburner.com/TanTanMusic" class="feed" title="Free full-length MP3 tracks delivered to your iPod">Subscribe to Music Podcast</a>
</p>
-->
</div>        
        <?endif;?>
<?endif;?>